Repository navigation
Label rows of directed models as outgoing, columns as incoming - #74
Draft
alexpghayes wants to merge 1 commit into
Draft
alexpghayes wants to merge 1 commit into
alexpghayes wants to merge 1 commit into
Conversation
Rows of A are senders: X, z_out and theta_out describe outgoing edges, and expected_out_degree() is edges / n. print.directed_factor_model(), the directed_factor_model() docs, the validate_directed_dcsbm() error messages and the directed_dcsbm() details had incoming and outgoing swapped in places. Make every label match the code, and write out the edge rate lambda[i, j] = theta_out[i] B[x[i], y[j]] theta_in[j]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
The convention in the code is rows of
A= senders = outgoing =X/z_out/theta_out, andexpected_out_degree()is edges /n. Several labels had it backwards:print.directed_factor_model()calledn/k1"Incoming Nodes" / "Incoming Rank" andd/k2"Outgoing".directed_factor_model()@param X/@param Yand@returndocs had the same swap.validate_directed_dcsbm()messages calledz_out/pi_outthe "incoming rank" (and one saidz1).directed_dcsbm()details describedxas the incoming block but drew it frompi_out, and calledθ_outthe propensity for incoming edges. Theforce_identifiabilitydoc saidtheta_outwas normalized within incoming blocks; the code normalizes within outgoing blocks.Fix
Every label now follows the convention above. The "Edge formulation" details also state the rate explicitly,
lambda[i, j] = theta_out[i] * B[x[i], y[j]] * theta_in[j], and fix a couple of typos. There are no code changes beyond strings.Tests
Added to
tests/testthat/test-directedness.R: the print labels of a 3 × 5 model, out/in degree as edges per row/column, and the validator messages forpi_out/pi_in. Fails onmain(4 failures, 1 error), passes here. Full suite passes. Docs regenerated with roxygen2 7.3.2 (directed_erdos_renyi.Rdinherits thedirected_factor_model()docs).NEWS
Left out to avoid conflicting with #59. Suggested bullet under Documentation:
🤖 Generated with Claude Code